package cho114366.basic;

public class Ch04_Q2 {

	public static void main(String[] args) {
		Rec r = new Rec();
		Rec s = new Rec(-2, 2, -1, 4);

		r.show();
		s.show();
		System.out.println(s.square());
		r.set(-2, 2, -1, 4);
		r.show();
		System.out.println(r.square());
		if(r.equals(s)){
			System.out.println("true");
			}
		else{System.out.println("false");
	}	
	}

}

class Rec {
	int x1;
	int y1;
	int x2;
	int y2;
	void set(int x1, int y1, int x2, int y2) {
	}
	public Rec() {

	}

	public Rec(int x1, int y1, int x2, int y2) {
		this.x1 = x1;
		this.x2 = x2;
		this.y1 = y1;
		this.y2 = y2;
	}

	int square() {
		int a = (x2 - x1) * (y2 - y1);
		return a;

	}

	void show() {
		System.out.println("좌표?" + x1+"," + y1+","+"and"+x2+y2);
		System.out.println("넓이는?" + square());
		
}
}
